home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Magazine / PC2Amiga / Samba / source / amiga / wrapper / fcntl.h next >
Encoding:
C/C++ Source or Header  |  2000-12-25  |  2.1 KB  |  72 lines

  1. #ifndef _WRAPPER_FCNTL_H
  2. #define _WRAPPER_FCNTL_H 1
  3.  
  4. /*
  5.  * $Id: fcntl.h 1.3 2000/12/25 11:49:31 olsen Exp olsen $
  6.  *
  7.  * :ts=4
  8.  *
  9.  * AmigaOS wrapper routines for Samba 2.0.0, using the AmiTCP V3 API
  10.  * and the SAS/C V6.58 compiler.
  11.  *
  12.  * Copyright (C) 1999-2000 by Olaf `Olsen' Barthel <olsen@sourcery.han.de>
  13.  *
  14.  * This program is free software; you can redistribute it and/or modify
  15.  * it under the terms of the GNU General Public License as published by
  16.  * the Free Software Foundation; either version 2 of the License, or
  17.  * (at your option) any later version.
  18.  * 
  19.  * This program is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22.  * GNU General Public License for more details.
  23.  * 
  24.  * You should have received a copy of the GNU General Public License
  25.  * along with this program; if not, write to the Free Software
  26.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  */
  28.  
  29. /****************************************************************************/
  30.  
  31. #include "include:fcntl.h"
  32.  
  33. /* We are going to replace these few. */
  34. #undef creat
  35. #undef lseek
  36. #undef open
  37. #undef read
  38. #undef write
  39. #undef close
  40.  
  41. /****************************************************************************/
  42.  
  43. #include <sys/types.h>
  44.  
  45. /* Advisory file segment locking data type -
  46.  * information passed to system by user
  47.  */
  48. struct flock
  49. {
  50.     short    l_type;        /* lock type: read/write, etc. */
  51.     short    l_whence;    /* type of l_start */
  52.     off_t    l_start;    /* starting offset */
  53.     off_t    l_len;        /* len = 0 means until end of file */
  54.     pid_t    l_pid;        /* lock owner */
  55. };
  56.  
  57. #define F_GETLK        100    /* get record locking information */
  58. #define F_SETLK        101    /* set record locking information */
  59. #define F_SETLKW    102    /* F_SETLK; wait if blocked */
  60.  
  61. #define F_RDLCK        1    /* shared or read lock */
  62. #define F_UNLCK        2    /* unlock */
  63. #define F_WRLCK        3    /* exclusive or write lock */
  64.  
  65. /****************************************************************************/
  66.  
  67. #define O_NONBLOCK    4    /* no delay */
  68.  
  69. /****************************************************************************/
  70.  
  71. #endif /* _WRAPPER_FCNTL_H */
  72.